package net.springmvc11_12.controller;

import net.springmvc11_12.entity.Stu;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("user")
public class UserRestFulController {

    @GetMapping("/{id}")
    public String getUser(@PathVariable int id) {
        return id + "根据id查询";
    }

    @GetMapping
    public String getUsers() {
        return "查询所有list";
    }

    @PostMapping
    public String addUser(@RequestBody Stu stu) {
        return "添加操作";
    }
    @PutMapping
    public String updateUser(@RequestBody Stu stu) {

        return "修改操作";
    }
    @DeleteMapping("/{id}")
    public String deleteUser(@PathVariable int id) {
        return "删除操作";
    }
}
